﻿// Copyright (c) 2014 Converter Systems LLC

using System;
using System.ComponentModel;

namespace ConverterSystems.ServiceModel
{
    /// <summary>
    /// Specifies the Opc.Ua.MonitoredItem that will be bound to this property.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class MonitoredItemAttribute : Attribute
    {
        public MonitoredItemAttribute()
        {
            AttributeId = 13u;
            SamplingInterval = -1;
            QueueSize = 0u;
            DiscardOldest = true;
            CacheQueueSize = 120;
        }

        public string StartNodeId { get; set; }

        public string RelativePath { get; set; }

        [DefaultValue(13u)]
        public uint AttributeId { get; set; }

        public string IndexRange { get; set; }

        [DefaultValue(-1)]
        public int SamplingInterval { get; set; }

        [DefaultValue(0u)]
        public uint QueueSize { get; set; }

        [DefaultValue(true)]
        public bool DiscardOldest { get; set; }

        [DefaultValue(120)]
        public int CacheQueueSize { get; set; }

        public string Filter { get; set; }
    }
}